-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GODRIVER-2972 Fix wiremessage RequestID race in operation.Execute #1375
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find! Looks good 👍
@@ -1120,7 +1125,7 @@ func (op Operation) createMsgWireMessage(ctx context.Context, maxTimeMS uint64, | |||
flags |= wiremessage.ExhaustAllowed | |||
} | |||
|
|||
info.requestID = wiremessage.CurrentRequestID() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: Are any uses of CurrentRequestID
safe? Should we remove that function completely and only call NextRequestID
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Idea, I would guess not since the requestID is a global variable. Done.
API Change Report./x/mongo/driver/wiremessageincompatible changesCurrentRequestID: removed |
GODRIVER-2972
Summary
The usage of "wiremessage.CurrentRequestID()" in the operation.Execute method will cause a race condition where concurrent calls to Execute will result in wire messages from different operations sending the same RequestID to the server.
Background & Motivation
NA